<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>我的收藏 - 邦伴用户端</title>
  <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
  <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" rel="stylesheet">
  <style>
    :root {
      --primary: #ff7e2d;
      --primary-light: #fff3ea;
      --border: #f0f0f0;
      --text-main: #222;
      --text-sub: #888;
    }
    
    body {
      font-family: 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
      background-color: #f8f8f8;
      color: var(--text-main);
    }
    
    .app-container {
      width: 375px;
      height: 812px;
      margin: 0 auto;
      background: #fff;
      position: relative;
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
      overflow-y: auto;
    }
    
    .primary-color {
      color: var(--primary);
    }
    
    .primary-bg {
      background-color: var(--primary);
    }
    
    .primary-light-bg {
      background-color: var(--primary-light);
    }
    
    .btn-primary {
      background-color: var(--primary);
      color: white;
    }
    
    .btn-outline {
      border: 1px solid var(--primary);
      color: var(--primary);
    }
    
    .card {
      border-radius: 12px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    }
    
    .tab-active {
      color: var(--primary);
      border-bottom: 2px solid var(--primary);
    }
    
    .product-image {
      height: 120px;
      background-color: #f3f4f6;
      display: flex;
      align-items: center;
      justify-content: center;
      border-top-left-radius: 12px;
      border-top-right-radius: 12px;
    }
  </style>
</head>
<body>
  <div class="app-container">
    <!-- 顶部导航栏 -->
    <div class="sticky top-0 z-10 bg-white border-b border-gray-100 px-4 py-3 flex items-center">
      <a href="javascript:history.back()" class="mr-2">
        <i class="fas fa-arrow-left text-lg"></i>
      </a>
      <h1 class="text-lg font-medium flex-1 text-center">我的收藏</h1>
      <div class="flex items-center">
        <button id="editBtn" class="text-sm text-gray-500">编辑</button>
        <button id="doneBtn" class="text-sm primary-color hidden">完成</button>
      </div>
    </div>
    
    <!-- 标签页 -->
    <div class="px-4 border-b border-gray-200">
      <div class="flex">
        <div class="tab-active px-6 py-3 text-center">
          <span>商品</span>
        </div>
        <div class="px-6 py-3 text-center text-gray-500">
          <span>服务</span>
        </div>
        <div class="px-6 py-3 text-center text-gray-500">
          <span>护理师</span>
        </div>
      </div>
    </div>
    
    <!-- 收藏列表 -->
    <div class="p-4">
      <div id="products-tab" class="grid grid-cols-2 gap-3">
        <!-- 商品1 -->
        <div class="card bg-white overflow-hidden relative">
          <div class="product-image">
            <i class="fas fa-wheelchair text-4xl text-gray-400"></i>
          </div>
          <div class="p-3">
            <h3 class="text-sm font-medium mb-1">轻便折叠轮椅</h3>
            <p class="text-xs text-gray-500 mb-2">铝合金材质 轻便耐用</p>
            <div class="flex justify-between items-center">
              <span class="text-sm primary-color font-bold">¥299</span>
              <div class="flex">
                <a href="product_detail.html" class="text-xs bg-gray-100 px-2 py-1 rounded mr-1">查看</a>
                <button class="text-xs primary-bg text-white px-2 py-1 rounded">加购</button>
              </div>
            </div>
          </div>
          <div class="absolute top-2 right-2 checkbox-container hidden">
            <input type="checkbox" class="w-4 h-4 accent-primary">
          </div>
        </div>
        
        <!-- 商品2 -->
        <div class="card bg-white overflow-hidden relative">
          <div class="product-image">
            <i class="fas fa-heartbeat text-4xl text-gray-400"></i>
          </div>
          <div class="p-3">
            <h3 class="text-sm font-medium mb-1">电子血压计</h3>
            <p class="text-xs text-gray-500 mb-2">高精准 语音播报</p>
            <div class="flex justify-between items-center">
              <span class="text-sm primary-color font-bold">¥199</span>
              <div class="flex">
                <a href="product_detail.html" class="text-xs bg-gray-100 px-2 py-1 rounded mr-1">查看</a>
                <button class="text-xs primary-bg text-white px-2 py-1 rounded">加购</button>
              </div>
            </div>
          </div>
          <div class="absolute top-2 right-2 checkbox-container hidden">
            <input type="checkbox" class="w-4 h-4 accent-primary">
          </div>
        </div>
        
        <!-- 商品3 -->
        <div class="card bg-white overflow-hidden relative">
          <div class="product-image">
            <i class="fas fa-walking text-4xl text-gray-400"></i>
          </div>
          <div class="p-3">
            <h3 class="text-sm font-medium mb-1">老人助行器</h3>
            <p class="text-xs text-gray-500 mb-2">可折叠 铝合金材质</p>
            <div class="flex justify-between items-center">
              <span class="text-sm primary-color font-bold">¥199</span>
              <div class="flex">
                <a href="product_detail.html" class="text-xs bg-gray-100 px-2 py-1 rounded mr-1">查看</a>
                <button class="text-xs primary-bg text-white px-2 py-1 rounded">加购</button>
              </div>
            </div>
          </div>
          <div class="absolute top-2 right-2 checkbox-container hidden">
            <input type="checkbox" class="w-4 h-4 accent-primary">
          </div>
        </div>
        
        <!-- 商品4 -->
        <div class="card bg-white overflow-hidden relative">
          <div class="product-image">
            <i class="fas fa-chair text-4xl text-gray-400"></i>
          </div>
          <div class="p-3">
            <h3 class="text-sm font-medium mb-1">老人洗澡椅</h3>
            <p class="text-xs text-gray-500 mb-2">防滑设计 安全舒适</p>
            <div class="flex justify-between items-center">
              <span class="text-sm primary-color font-bold">¥159</span>
              <div class="flex">
                <a href="product_detail.html" class="text-xs bg-gray-100 px-2 py-1 rounded mr-1">查看</a>
                <button class="text-xs primary-bg text-white px-2 py-1 rounded">加购</button>
              </div>
            </div>
          </div>
          <div class="absolute top-2 right-2 checkbox-container hidden">
            <input type="checkbox" class="w-4 h-4 accent-primary">
          </div>
        </div>
      </div>
      
      <!-- 服务标签页 -->
      <div id="services-tab" class="hidden">
        <div class="space-y-4">
          <!-- 服务1 -->
          <div class="card bg-white p-3 relative">
            <div class="flex">
              <div class="w-20 h-20 bg-gray-100 rounded-lg flex items-center justify-center mr-3">
                <i class="fas fa-user-nurse text-3xl text-gray-400"></i>
              </div>
              <div class="flex-1">
                <h3 class="font-medium mb-1">专业居家护理</h3>
                <p class="text-xs text-gray-500 mb-1">专业护理人员上门服务</p>
                <div class="flex items-center text-xs text-yellow-500 mb-1">
                  <i class="fas fa-star"></i>
                  <i class="fas fa-star"></i>
                  <i class="fas fa-star"></i>
                  <i class="fas fa-star"></i>
                  <i class="fas fa-star-half-alt"></i>
                  <span class="text-gray-500 ml-1">4.8 (256评价)</span>
                </div>
                <div class="flex justify-between items-center">
                  <span class="text-sm primary-color font-bold">¥198/次</span>
                  <a href="service_detail.html" class="text-xs primary-bg text-white px-3 py-1 rounded-full">预约</a>
                </div>
              </div>
            </div>
            <div class="absolute top-2 right-2 checkbox-container hidden">
              <input type="checkbox" class="w-4 h-4 accent-primary">
            </div>
          </div>
          
          <!-- 服务2 -->
          <div class="card bg-white p-3 relative">
            <div class="flex">
              <div class="w-20 h-20 bg-gray-100 rounded-lg flex items-center justify-center mr-3">
                <i class="fas fa-hand-holding-medical text-3xl text-gray-400"></i>
              </div>
              <div class="flex-1">
                <h3 class="font-medium mb-1">康复理疗服务</h3>
                <p class="text-xs text-gray-500 mb-1">专业康复师指导</p>
                <div class="flex items-center text-xs text-yellow-500 mb-1">
                  <i class="fas fa-star"></i>
                  <i class="fas fa-star"></i>
                  <i class="fas fa-star"></i>
                  <i class="fas fa-star"></i>
                  <i class="fas fa-star"></i>
                  <span class="text-gray-500 ml-1">5.0 (128评价)</span>
                </div>
                <div class="flex justify-between items-center">
                  <span class="text-sm primary-color font-bold">¥298/次</span>
                  <a href="service_detail.html" class="text-xs primary-bg text-white px-3 py-1 rounded-full">预约</a>
                </div>
              </div>
            </div>
            <div class="absolute top-2 right-2 checkbox-container hidden">
              <input type="checkbox" class="w-4 h-4 accent-primary">
            </div>
          </div>
        </div>
      </div>
      
      <!-- 护理师标签页 -->
      <div id="workers-tab" class="hidden">
        <div class="space-y-4">
          <!-- 护理师1 -->
          <div class="card bg-white p-3 relative">
            <div class="flex">
              <div class="w-16 h-16 rounded-full bg-primary-light flex items-center justify-center mr-3 text-lg font-bold primary-color">
                张
              </div>
              <div class="flex-1">
                <h3 class="font-medium mb-1">张阿姨</h3>
                <p class="text-xs text-gray-500 mb-1">5年经验 | 持证上岗</p>
                <div class="flex items-center text-xs text-yellow-500 mb-1">
                  <i class="fas fa-star"></i>
                  <i class="fas fa-star"></i>
                  <i class="fas fa-star"></i>
                  <i class="fas fa-star"></i>
                  <i class="fas fa-star"></i>
                  <span class="text-gray-500 ml-1">5.0 (56评价)</span>
                </div>
                <div class="flex justify-between items-center">
                  <span class="text-xs text-gray-500">擅长：老人护理、康复训练</span>
                  <a href="worker_detail.html" class="text-xs primary-bg text-white px-3 py-1 rounded-full">查看</a>
                </div>
              </div>
            </div>
            <div class="absolute top-2 right-2 checkbox-container hidden">
              <input type="checkbox" class="w-4 h-4 accent-primary">
            </div>
          </div>
          
          <!-- 护理师2 -->
          <div class="card bg-white p-3 relative">
            <div class="flex">
              <div class="w-16 h-16 rounded-full bg-primary-light flex items-center justify-center mr-3 text-lg font-bold primary-color">
                李
              </div>
              <div class="flex-1">
                <h3 class="font-medium mb-1">李大姐</h3>
                <p class="text-xs text-gray-500 mb-1">3年经验 | 持证上岗</p>
                <div class="flex items-center text-xs text-yellow-500 mb-1">
                  <i class="fas fa-star"></i>
                  <i class="fas fa-star"></i>
                  <i class="fas fa-star"></i>
                  <i class="fas fa-star"></i>
                  <i class="fas fa-star-half-alt"></i>
                  <span class="text-gray-500 ml-1">4.7 (42评价)</span>
                </div>
                <div class="flex justify-between items-center">
                  <span class="text-xs text-gray-500">擅长：生活照料、康复护理</span>
                  <a href="worker_detail.html" class="text-xs primary-bg text-white px-3 py-1 rounded-full">查看</a>
                </div>
              </div>
            </div>
            <div class="absolute top-2 right-2 checkbox-container hidden">
              <input type="checkbox" class="w-4 h-4 accent-primary">
            </div>
          </div>
        </div>
      </div>
    </div>
    
    <!-- 底部删除按钮 -->
    <div id="deleteBar" class="fixed bottom-0 left-0 right-0 bg-white border-t border-gray-100 p-4 hidden" style="width: 375px; margin: 0 auto;">
      <div class="flex justify-between items-center">
        <div class="flex items-center">
          <input type="checkbox" id="selectAll" class="w-4 h-4 mr-2 accent-primary">
          <label for="selectAll" class="text-sm">全选</label>
        </div>
        <button id="deleteBtn" class="px-6 py-2 bg-red-500 text-white rounded-lg">删除</button>
      </div>
    </div>
  </div>

  <script>
    document.addEventListener('DOMContentLoaded', function() {
      // 标签页切换
      const tabs = document.querySelectorAll('.px-4.border-b.border-gray-200 .px-6.py-3');
      const contentDivs = [
        document.getElementById('products-tab'),
        document.getElementById('services-tab'),
        document.getElementById('workers-tab')
      ];
      
      tabs.forEach((tab, index) => {
        tab.addEventListener('click', function() {
          // 移除所有标签的激活状态
          tabs.forEach(t => {
            t.classList.remove('tab-active');
            t.classList.add('text-gray-500');
          });
          
          // 激活当前标签
          this.classList.add('tab-active');
          this.classList.remove('text-gray-500');
          
          // 显示对应内容，隐藏其他内容
          contentDivs.forEach((div, i) => {
            if (i === index) {
              div.classList.remove('hidden');
            } else {
              div.classList.add('hidden');
            }
          });
        });
      });
      
      // 编辑模式
      const editBtn = document.getElementById('editBtn');
      const doneBtn = document.getElementById('doneBtn');
      const deleteBar = document.getElementById('deleteBar');
      const checkboxContainers = document.querySelectorAll('.checkbox-container');
      const selectAllCheckbox = document.getElementById('selectAll');
      const deleteBtn = document.getElementById('deleteBtn');
      
      editBtn.addEventListener('click', function() {
        // 切换按钮显示
        editBtn.classList.add('hidden');
        doneBtn.classList.remove('hidden');
        
        // 显示底部删除栏和复选框
        deleteBar.classList.remove('hidden');
        checkboxContainers.forEach(container => {
          container.classList.remove('hidden');
        });
      });
      
      doneBtn.addEventListener('click', function() {
        // 切换按钮显示
        doneBtn.classList.add('hidden');
        editBtn.classList.remove('hidden');
        
        // 隐藏底部删除栏和复选框
        deleteBar.classList.add('hidden');
        checkboxContainers.forEach(container => {
          container.classList.add('hidden');
        });
        
        // 取消所有选中状态
        const allCheckboxes = document.querySelectorAll('.checkbox-container input[type="checkbox"]');
        allCheckboxes.forEach(checkbox => {
          checkbox.checked = false;
        });
        selectAllCheckbox.checked = false;
      });
      
      // 全选/取消全选
      selectAllCheckbox.addEventListener('change', function() {
        const allCheckboxes = document.querySelectorAll('.checkbox-container input[type="checkbox"]');
        allCheckboxes.forEach(checkbox => {
          checkbox.checked = this.checked;
        });
      });
      
      // 删除选中项
      deleteBtn.addEventListener('click', function() {
        const checkedItems = document.querySelectorAll('.checkbox-container input[type="checkbox"]:checked');
        
        if (checkedItems.length === 0) {
          alert('请选择要删除的项目');
          return;
        }
        
        if (confirm(`确定要删除选中的 ${checkedItems.length} 项吗？`)) {
          checkedItems.forEach(checkbox => {
            // 找到对应的卡片元素并移除
            const card = checkbox.closest('.card');
            card.remove();
          });
          
          // 重置全选复选框
          selectAllCheckbox.checked = false;
        }
      });
    });
  </script>
</body>
</html> 